<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
JRequest::setVar( 'hidemainmenu', 1 );
JHTML::_('behavior.tooltip');
jimport('joomla.html.pane');
$pane =& JPane::getInstance('tabs',array('startOffset'=>0)); 

JFilterOutput::objectHTMLSafe( $this->row);

$createdate	 	= &JFactory::getDate();
$nowdate		= JHTML::_('date', $createdate->toUnix(), '%Y-%m-%d %H:%M:%S');

$config 		= &JComponentHelper::getParams('com_feed_manager');
$data_type 		= $config->get('data_type');

JHTML::_('behavior.mootools');
$document =& JFactory::getDocument();

$config 		= &JComponentHelper::getParams('com_feed_manager');
$data_type 		= $config->get('data_type');

$document->addScript('components/com_feed_manager/assets/base64.js');
//if ($data_type == 'joomla')
//{
//	$document->addScript('components/com_feed_manager/assets/js/step.js');
//	$document->addScript('components/com_feed_manager/assets/js/contentlink.js');
//}			
//elseif ($data_type == 'drupal') 
//	$document->addScript('components/com_feed_manager/assets/drupal_step.js');
//else 
//	$document->addScript('components/com_feed_manager/assets/wordpress_step.js');
//	
//$document->addScript('http://www.google.com/jsapi');

$document->addScript('components/com_feed_manager/assets/js/feed.js');

$find_replace_tip = JText::_('Use RegExp to replace data.&lt;br/&gt;Each pattern per line. Examples:&lt;br/&gt;/Joomla/i<=>some words&lt;br/&gt; will find all \'joomla\' words and replace by \'some words\'');

?>
<style type="text/css">	 
	.ajax-loading {
		padding: 20px 0;
		background: url(components/com_feed_manager/assets/images/spinner.gif) no-repeat center;
	}
</style>
<form action="index.php?option=com_feed_manager" method="post" name="adminForm" id="newsForm">
<?php
echo $pane->startPane( 'pane' );
// PANEL 1
/*BEGIN STEP 1*/
echo $pane->startPanel( JText::_('Step 1'), 'istep1' );
?>
<!--content-->
	<div class="formstep" id="step1">
	<fieldset>
		<legend>Link:</legend>
			<table class="admintable" width="100%">
				<tr>
					<td width="80px" align="">
						<span class="editlinktip hasTip" title="<?php echo JText::_( 'Link RSS/HTTP' );?>::<?php echo JText::_('Link RSS/HTTP that you want to fetch news from'); ?>">
						<strong>Link:</strong>
						</span>
					</td>
					<td width="500px">
						<input style="width:500px;" type="text" name="link" id="link" value="<?php echo $this->row->link; ?>" />
					</td>
					<td width="80px">
						<span class="editlinktip hasTip" title="<?php echo JText::_( 'Plug-in' );?>::<?php echo JText::_('Select Regexp\'s plug-in '); ?>">
						<strong>Plug-in:</strong>
						</span>
					</td>
					<td width="100">
						<?php echo $this->lists['plugin_id']; ?>
					</td>
					<td>
<!--						published 	-->
						published:
						<input type="radio" name="published" <?php if ($this->row->published) echo 'checked="checked"'; ?> value="1" >
						yes
						<input type="radio" name="published" <?php if (!$this->row->published) echo 'checked="checked"'; ?> value="0" >
						no
					</td>	
					<td width="40px"> feed id: </td>				
					<td width="200"> <input style="width:50px;" type="text" value="<?php echo $this->row->feedId; ?>" name="feedId" /> </td>				
				</tr>				
			</table>
			<table>
				<tr>
					<td width="70">&nbsp;</td>
					<td width="200"><label style="color: #777"><?php echo $this->row->title_original; ?></label></td>
					<td width="70">&nbsp;</td>
					<td width="400">
						<label style="color: #777"><?php echo $this->row->description_original; ?></label>
					</td>
				</tr>
				<tr>
					<td>title:</td>
					<td><input type="text" value="<?php echo $this->row->title; ?>" name="title" size="50" /></td>
					<td>Description:</td>
					<td>
						<textarea cols="60" name="description"><?php echo $this->row->description; ?></textarea>
					</td>
				</tr>
			</table>
			<table>
				<tr>
					<td width="70"> section Name:</td>
					<td width="200"> <input type="text" value="<?php echo $this->row->secName; ?>" name="secName" size="50" /></td>
					<td width="70">section id: </td>					
					<td width="200"><input type="text" value="<?php echo $this->row->secid; ?>" name="secid" size="50" /></td>					
				</tr>
			</table>
			<table>
				<tr>
					<td width="70"> category Name:</td>
					<td width="200"> <input type="text" value="<?php echo $this->row->catName; ?>" name="catName" size="50" /></td>
					<td width="70"> category id:</td>				
					<td width="200"> <input type="text" value="<?php echo $this->row->catid; ?>" name="catid" size="50" /></td>				
				</tr>
			</table>
	</fieldset>
	</div>
<?php
echo $pane->endPanel();
/*END PANEL 1*/

/*BEGIN STEP 2*/
// PANEL 2
echo $pane->startPanel( JText::_('Step 2'), 'istep2' );
?>
	<div class="formstep" id="step2">
		<fieldset>
		<legend>Get Links</legend>
		<table class="admintable" width="100%">
			<tr>
				<td width="100">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'RegExp' );?>::<?php echo JText::_('Input a regexp to get content\'s links'); ?>">
					<strong>RegExp:</strong>
					</span>
				</td>
				<td width="60">
					<input type="text" name="getlink_reg" id="getlink_reg" value="<?php echo $this->row->getLink_reg; ?>" size="100" />
				</td>
				<td width="10">
					<input type="text" name="getlink_sub" id="getlink_sub" value="<?php echo $this->row->getLink_sub; ?>" size="5" />
				</td>
				<td>
					<input type="button" id="testlink" name="testlink" class="btn-test" value="Test" />
				</td>
			</tr>
			<tr>
				<td>
					
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Find and Replace (RegExp)' );?>::<?php echo $find_replace_tip; ?>">
					<strong>Find and Replace (RegExp):</strong>
					</span>
				</td>
				<td colspan="3">			
						<textarea name="find_replace_links" id="find_replace_links" cols="99" rows="10"><?php echo $this->row->find_replace_links; ?></textarea>
				</td>
				
			</tr>
		</table>
		</fieldset>
		<div id="step2_test"></div>
	</div>
<?php
echo $pane->endPanel();
/*END PANEL 2*/

/*BEGIN STEP 3*/
echo $pane->startPanel( JText::_('Step 3'), 'istep3' );
?>
	<div class="formstep" id="step3">
		<fieldset>
		<legend>Get Titles</legend>
		<table class="admintable" width="100%">
			<tr>
				<td width="100">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'RegExp' );?>::<?php echo JText::_('Input a regexp to get article\'s titles'); ?>">
					<strong>RegExp:</strong>
					</span>
				</td>
				<td width="60">
					<input type="text" name="gettitle_reg" id="gettitle_reg" value="<?php echo $this->row->getTitle_reg; ?>" size="100" />
				</td>
				<td width="10">
					<input type="text" name="gettitle_sub" id="gettitle_sub" value="<?php echo $this->row->getTitle_sub; ?>" size="5" />
				</td>
				<td>
					<input type="button" id="testtitle" name="testtitle" value="Test" class="btn-test" />
				</td>
			</tr>
			<tr>
				<td>
					
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Find and Replace (RegExp)' );?>::<?php echo $find_replace_tip; ?>">
					<strong>Find and Replace (RegExp):</strong>
					</span>
				</td>
				<td colspan="3">			
						<textarea name="find_replace_titles" id="find_replace_titles" cols="99" rows="10"><?php echo $this->row->find_replace_titles; ?></textarea>
				</td>
				
			</tr>
		</table>
		</fieldset>
		<div id="step3_test"></div>
	</div>
<?php

echo $pane->endPanel();
/*END PANEL 3*/

/*BEGIN STEP 4*/
echo $pane->startPanel( JText::_('Step 4'), 'istep4' );
?>
	<div class="formstep" id="step4">
	
	<fieldset>
		<legend>Get Date</legend>
		<table class="admintable" width="100%">
			<tr>
				<td>	Get date from: 
				</td>
				<td colspan="2">
					<?php echo $this->lists['getDateAway']; ?>
				</td>
			</tr>
			<tr>				
				<td width="100">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'RegExp' );?>::<?php echo JText::_('Input a regexp to get article\'s date'); ?>">
					<strong>RegExp:</strong>
					</span>
				</td>
				<td width="60">
					<input type="text" name="getDate_reg" id="getDate_reg" value="<?php echo $this->row->getDate_reg; ?>" size="100" />
				</td>
				<td width="10">
					<input type="text" name="getDate_sub" id="getDate_sub" value="<?php echo $this->row->getDate_sub; ?>" size="5" />
				</td>
				<td>
					<input type="button" id="testdate" name="testdate" value="Test" class="btn-test" />
				</td>
			</tr>
			<tr>
				<td>
					
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Find and Replace (RegExp)' );?>::<?php echo $find_replace_tip; ?>">
					<strong>Find and Replace (RegExp):</strong>
					</span>
				</td>
				<td colspan="3">			
						<textarea name="find_replace_dates" id="find_replace_dates" cols="99" rows="10"><?php echo $this->row->find_replace_dates; ?></textarea>
				</td>
				
			</tr>
		</table>
		</fieldset>
		<div id="step4_test"></div>
	
	</div>
<?php

echo $pane->endPanel();	
/*END PANEL 4*/

/*BEGIN STEP 5*/
echo $pane->startPanel( JText::_('Step 5'), 'istep5' );
?>
	<div class="formstep" id="step5">
		<fieldset>
		<legend>Get Introtext</legend>
		<table class="admintable" width="100%">
			<tr>
				<td width="100">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Get Introtext' );?>::<?php echo JText::_('Introtext configuration'); ?>">
					<strong>Get Introtext:</strong>
					</span>
				</td>
				<td width="60">
					<input type="text" id="getintro_reg" name="getIntro_reg" value="<?php echo $this->row->getIntro_reg; ?>" size="100" />
				</td>
				<td width="10">
					<input type="text" id="getintro_sub" name="getIntro_sub" value="<?php echo $this->row->getIntro_sub; ?>" size="5" />
				</td>
				<td>
					<input type="button" id="testintro" name="testintro" value="Test"  class="btn-test" />
				</td>
			</tr>
			
			<tr>
				<td width="100">
					
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Find and Replace (RegExp)' );?>::<?php echo JText::_('Use RegExp to replace data. Each pattern in one line. For ex: /Joomla/i<=>anything'); ?>">
					<strong>Find and Replace (RegExp):</strong>
					</span>
				</td>
				<td colspan="3">
						<textarea name="find_replace_intros" id="find_replace_intro" cols="99" rows="10"><?php echo $this->row->find_replace_intros; ?></textarea>
				</td>
				
			</tr>
		</table>
		</fieldset>
		<div id="step5_test"></div>
	</div>
<?php
echo $pane->endPanel();	
/*END PANEL 5*/

/*BEGIN STEP 6*/
echo $pane->startPanel( JText::_('Step 6'), 'istep6' );
?>
	<div class="formstep" id="step6">
		<fieldset>
		<legend>Get Fulltext</legend>
		<table class="admintable" width="100%">
			<tr>
				<td width="100">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Get Fulltext' );?>::<?php echo JText::_('Fulltext configuration'); ?>">
					<strong>Get Fulltext:</strong>
					</span>
				</td>
				<td width="60">
					<input type="text" id="getfull_reg" name="getfull_reg" value="<?php echo $this->row->getFull_reg; ?>" size="100" />
				</td>
				<td width="10">
					<input type="text" id="getfull_sub" name="getfull_sub" value="<?php echo $this->row->getFull_sub; ?>" size="5" />
				</td>
				<td>
					<input type="button" id="testfull" name="testfull" value="Test" class="btn-test" />
				</td>
			</tr>		
			<tr>
				<td width="100">
					
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Find and Replace (RegExp)' );?>::<?php echo JText::_('Use RegExp to replace data. Each pattern in one line. For ex: /Joomla/i<=>anything'); ?>">
					<strong>Find and Replace (RegExp):</strong>
					</span>
				</td>
				<td colspan="3">			
						<textarea name="find_replace_fulls" id="find_replace_full" cols="99" rows="10"><?php echo $this->row->find_replace_fulls; ?></textarea>
				</td>
				
			</tr>
		</table>
		</fieldset>
		<div id="step6_test"></div>
	</div>
<?php

echo $pane->endPanel();	
/*END PANEL 6*/

/*BEGIN STEP 7*/
echo $pane->startPanel( JText::_('Step 7'), 'istep7' );

?>
	<div class="formstep" id="step7">
		<fieldset>
		<legend>Get-Image</legend>
		<table class="admintable" width="100%">
			<tr>
				<td width="10%">
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Get Images' );?>::<?php echo JText::_('Images configuration'); ?>">
					<strong>Get Images:</strong>
					</span>
				</td>
				<td width="35%">
					<input type="text" id="getimage_reg" name="getImage_reg" value="<?php echo $this->row->getImage_reg; ?>" size="100" />
				</td>
				<td width="5%"> Src 
					<input type="text" id="getisrc_sub" name="getISrc_sub" value="<?php echo $this->row->getISrc_sub; ?>" size="5" />
				</td>
				<td width="5%"> Title 
					<input type="text" id="getititle_sub" name="getITitle_sub" value="<?php echo $this->row->getITitle_sub; ?>" size="5" />
				</td>
				<td width="45%">
					<input type="button" id="test_pages_images" name="test_pages_images" value="Test" class="btn-test" />
				</td>
			</tr>		
			<tr>
				<td width="100">
					
					<span class="editlinktip hasTip" title="<?php echo JText::_( 'Find and Replace (RegExp)' );?>::<?php echo JText::_('Use RegExp to replace data. Each pattern in one line. For ex: /Joomla/i<=>anything'); ?>">
					<strong>Find and Replace (RegExp):</strong>
					</span>
				</td>
				<td colspan="3">			
						<textarea name="find_replace_images" id="find_replace_images" cols="99" rows="10"><?php echo $this->row->find_replace_images; ?></textarea>
				</td>
				
			</tr>
		</table>
		</fieldset>
		<div id="step7_test"></div>
	</div>
<?php
echo $pane->endPanel();	
/*END PANEL 7*/

/*BEGIN FINISH*/
echo $pane->startPanel( JText::_('Finish'), 'ifinish' );
	?>
		<div class="row1">
		<table class="admintable" width="100%">
			<tr>
				<td width="10%">
					Store max Number content
				</td>
				<td>
					<input name="numberStore" type="text" value="<?php echo $this->row->numberStore; ?>" />
				</td>	
			</tr>				
			<tr>
				<td width="10%">
					View Number content per page
				</td>
				<td>
					<input name="numberView" type="text" value="<?php echo $this->row->numberView; ?>" />
				</td>	
			</tr>				
		</table>
		<hr />
		<table class="admintable" width="100%">
			<tr>
				<td width="10%">
					Path to root Images
				</td>
				<td>
					<input name="pathImage" type="text" size="100" value="<?php echo $this->row->pathImage; ?>" />
				</td>	
			</tr>				
			<tr>
				<td width="10%">
					Link to root images
				</td>
				<td>
					<input name="linkImage" type="text" size="100" value="<?php echo $this->row->linkImage; ?>" />
				</td>	
			</tr>				
		</table>
		<div class="">
			<font size="30px" color="Maroon" dir="ltr">	</font>
		</div>
		</div>
	<?php
echo $pane->endPanel();	
/*END PANEL FINISH*/

echo $pane->endPane();
?>
	<div class="clr" style="clear:both;"></div>
	<div>
		<table class="admintable" width="100%">
			<tr>
				<td width="100%" valign="top">
				<div id="result"><!--div--></div>
				</td>			
			</tr>
			<tr>
				<td width="100%" valign="top">
				<div id="testplugin"><!--div--></div>
				</td>			
			</tr>
			<tr>
				<td width="100%" valign="top">
				<div id="getlink"><!--div--></div>
				</td>			
			</tr>
			<tr>
				<td width="100%" valign="top">
				<div id="gettitle"><!--div--></div>
				</td>			
			</tr>
			
			<tr>
				<td width="100%" valign="top">
				<div id="getintro"><!--div--></div>
				</td>			
			</tr>
			
			<tr>
				<td width="100%" valign="top">
				<div id="getfull"><!--div--></div>
				</td>			
			</tr>
			<tr>
				<td width="100%" valign="top">
				<div id="nextpage"><!--div--></div>
				</td>
			</tr>		
		</table>
		<div id="clr" style="display:none;"></div>
	</div>
	
	<div class="clr" style="clear:both;"></div>
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="oldtitle" value="<?php echo $this->row->link ; ?>" />
	<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />			
	<input type="hidden" name="task" value="" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
<div id="onloadingdata" style="z-index: 65555; position: fixed; top: 50%; left: 50%; width: 32px; height: 32px; margin-left: -16px; margin-top: -16px; display: none;" class="">
	<img height="100" width="100" src="components/com_feed_manager/assets/images/ajax-loader.gif"/>
</div>
<div id="yos-overlay" style="z-index: 65556; position: fixed; top: 0px; left: 0px; visibility: visible; opacity: 0.7; width: 100%; height: 100%; background: #000000; display:none; "><!--background--></div>
<div id="yos-window" style="z-index: 65557; position: fixed; top: 40%; left: 40%; width: 70%; padding:10px; margin-left: -350px; margin-top: -150px; background: #000000; -moz-border-radius: 5px; display:none;" class="">
<div id="yos-content" style="visibility: visible; opacity: 1; height: 450px; overflow: auto; background: #FFFFFF; padding: 10px;"><!--preview--></div>
</div>
